package com.qfedu.knowledge.entity.dto;

import lombok.Getter;
import lombok.Setter;
import org.springframework.lang.NonNull;

import java.util.Objects;

/**
 * @ClassName QuestionInfoDTO
 * @Author ykx
 * @Date 2024/1/8 20:31
 * @Version 1.0
 */
@Getter
@Setter
public class QuestionInfoDTO {

    /**
     * 题目id
     */
    private Long id;

    /**
     * 题目
     */
    @NonNull
    private String question;

    /**
     * 正确答案
     */
    private String answer;

    /**
     * 题目类型
     */
    private Integer type;

    /**
     * 选项A
     */
    private String optionA;

    /**
     * 选项B
     */
    private String optionB;

    /**
     * 选项C
     */
    private String optionC;

    /**
     * 选项D
     */
    private String optionD;

    /**
     * 正确答案选项
     */
    private String answerOption;

    public static Boolean isNonOption(QuestionInfoDTO questionInfoDTO) {
        return Objects.isNull(questionInfoDTO.getOptionA())
                && Objects.isNull(questionInfoDTO.getOptionB())
                && Objects.isNull(questionInfoDTO.getOptionC())
                && Objects.isNull(questionInfoDTO.getOptionD());
    }

}
